<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<!--
    [1,3,5,2,1,4,3,1,2,5,3,1,2,1] 对该数组去除重复数据
-->


<script>

    var arr = [1, 3, 5, 2, 1, 4, 3, 1, 2, 5, 3, 1, 2, 1]

    var newArray = []

    for (var i = 0; i < arr.length; i++) {
        if (newArray.indexOf(arr[i]) == -1) {
            newArray.push(arr[i])
        }
    }

    console.log(newArray);
</script>

</body>
</html>